package com.zsrt.java.day20170113.lh.daily;

import java.lang.reflect.Field;

import org.junit.Test;

public class Field02Test {

	
	@Test
	public void set() throws Exception {
		
		Class<?> clazz=Class.forName("com.zsrt.java.day20170113.lh.daily.Student");
		
		Object obj = clazz.newInstance();
		
		Field field=clazz.getDeclaredField("card");
		
		//打开访问权限的方法
		field.setAccessible(true);
		
		field.set(obj, 1001);
		
//		field.get("");
		System.out.println(field);
		
	}
}
